package com.culture.config.service.impl;

import javax.annotation.Resource;

import com.culture.config.common.util.BeanUtil;
import com.culture.config.dao.entity.JobLog;
import com.culture.config.dao.mapper.JobLogMapper;
import com.culture.config.model.po.JobLogPagePO;
import com.culture.config.model.vo.JobLogVO;
import com.culture.config.service.JobLogService;
import com.culture.config.wrapper.JobLogWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;

import org.springframework.stereotype.Service;

@Service
public class JobLogServiceImpl implements JobLogService {
    @Resource
    private JobLogMapper jobLogMapper;

    @Override
    public Page<JobLogVO> page(JobLogPagePO jobLogPagePO) {
        PageMethod.startPage(jobLogPagePO.getPageNum(), jobLogPagePO.getPageSize());
        Page<JobLog> pageLogs =  this.jobLogMapper.page(JobLogWrapper.wrapJobLogQeury(jobLogPagePO));
        return BeanUtil.copyPageProperties(pageLogs, JobLogVO.class);
    }
    
}
